<script>
  layui.use(['admin'], function () {
    let admin = layui.admin;
    admin.get('agent-admin/sidebar', function (res) {
      // 没有默认首页，自动跳转到第一个菜单页
      res.data.some(function (pMenu) {
        if (pMenu.list.length > 0) {
          location.hash = '/' + pMenu.list[0].jump;
          return true;
        }
        if (pMenu.jump != '') {
          location.hash = '/' + pMenu.jump;
          console.log('menu', pMenu);
          return true;
        }
      })
    })
  });
</script>
